Telegram Group & Telegram Channel
#нововведение

PEP 695 был принят! 🚨

PEP 695

В ближайщее время произойдут значительные изменения в синтаксе тайпваров и дженериков.
Вот как сейчас мы создаём generic type alias:

from typing import TypeAlias

_T = TypeVar("_T")

ListOrSet: TypeAlias = list[_T] | set[_T]

Теперь с утверждением данного пепа, это будет выглядить так:

type ListOrSet[T] = list[T] | set[T]

Кроме того синтаксис использования дженериков в классах также упростили.
Теперь он выглядить так:

class ClassA[T: str]:
def method1(self) -> T:
...


Где T - TypeVar.

Подробнее можно почитать об изменения тут.

Что вы думате по поводу подобных изменений? Считаете ли вы введение "var подобных" объявлений, хорошим вектором развития синтаксиса питона? 🤔



tg-me.com/pythonturboru/402
Create:
Last Update:

#нововведение

PEP 695 был принят! 🚨

PEP 695

В ближайщее время произойдут значительные изменения в синтаксе тайпваров и дженериков.
Вот как сейчас мы создаём generic type alias:

from typing import TypeAlias

_T = TypeVar("_T")

ListOrSet: TypeAlias = list[_T] | set[_T]

Теперь с утверждением данного пепа, это будет выглядить так:

type ListOrSet[T] = list[T] | set[T]

Кроме того синтаксис использования дженериков в классах также упростили.
Теперь он выглядить так:

class ClassA[T: str]:
def method1(self) -> T:
...


Где T - TypeVar.

Подробнее можно почитать об изменения тут.

Что вы думате по поводу подобных изменений? Считаете ли вы введение "var подобных" объявлений, хорошим вектором развития синтаксиса питона? 🤔

BY Python Turbo. Уютное сообщество Python разработчиков.




Share with your friend now:
tg-me.com/pythonturboru/402

View MORE
Open in Telegram


Python Turbo Уютное сообщество Python разработчиков Telegram | DID YOU KNOW?

Date: |

That strategy is the acquisition of a value-priced company by a growth company. Using the growth company's higher-priced stock for the acquisition can produce outsized revenue and earnings growth. Even better is the use of cash, particularly in a growth period when financial aggressiveness is accepted and even positively viewed.he key public rationale behind this strategy is synergy - the 1+1=3 view. In many cases, synergy does occur and is valuable. However, in other cases, particularly as the strategy gains popularity, it doesn't. Joining two different organizations, workforces and cultures is a challenge. Simply putting two separate organizations together necessarily creates disruptions and conflicts that can undermine both operations.

How Does Bitcoin Mining Work?

Bitcoin mining is the process of adding new transactions to the Bitcoin blockchain. It’s a tough job. People who choose to mine Bitcoin use a process called proof of work, deploying computers in a race to solve mathematical puzzles that verify transactions.To entice miners to keep racing to solve the puzzles and support the overall system, the Bitcoin code rewards miners with new Bitcoins. “This is how new coins are created” and new transactions are added to the blockchain, says Okoro.

Python Turbo Уютное сообщество Python разработчиков from ye


Telegram Python Turbo. Уютное сообщество Python разработчиков.
FROM USA